/*
 * @Author: fanyaqing
 * @Date: 2021-08-05 08:25:30
 * @LastEditTime: 2021-08-09 14:39:09
 * @LastEditors: fanyaqing
 * @Description: 
 * @FilePath: \supermall\src\router\index.js
 */
import Vue from 'vue';
import VueRouter from 'vue-router'

const Home =()=>import ('views/home/home.vue');
const Profile =()=>import ('views/profile/profile.vue');
const Category =()=>import ('views/category/category.vue');
const Shopcart =()=>import ('views/shopcart/shopcart.vue');
const Detail =()=>import ('views/detail/detail.vue');



// 1.安装插件
Vue.use(VueRouter)
// 2.创建router
const router =new VueRouter({
  routes:[
    {
      path:'',
      redirect:'/home'
    },{
      path:'/home',
      component:Home
    },{
      path:'/profile',
      component:Profile
    },{
      path:'/category',
      component:Category
    },{
      path:'/shopcart',
      component:Shopcart
    },{
      path:'/detail/:id',
      component:Detail
    }
  ]
})

export default router;
